package work;
import java.util.Scanner;
/**
 * @author Brace
 * @Title:
 * @Description:
 * @date 2020/4/1717:30
 */
public class Management {
    public static void main(String[] args){
        System.out.println("请输入课程的数量");
        Scanner inputNumber2 = new Scanner(System.in);
        int numberOfCourses = inputNumber2.nextInt();
        Course[] courses = new Course[numberOfCourses];
        for(int i = 0; i < numberOfCourses ; i++){
            courses[i] = new Course();
            System.out.println("请输入课程名称：");
            Scanner inputName = new Scanner(System.in);
            courses[i].setName(inputName.nextLine());
        }
        System.out.println("请输入学生数量：");
        //输入学生的数量
        Scanner inputNumber = new Scanner(System.in);
        //用户输入学生的数量
        int numberOfStudents = inputNumber.nextInt();
        //接收输入学生的数量
        Student[] students = new Student[numberOfStudents];
        //根据学生的数量，创建学生对象
        for(int i = 0; i < numberOfStudents ; i++){
            students[i] = new Student();
            System.out.println("请输入学生学号：");
            Scanner inputId = new Scanner(System.in);
            students[i].setId(inputId.nextLine());
            System.out.println("请输入学生姓名：");
            Scanner inputName = new Scanner(System.in);
            students[i].setName(inputName.nextLine());
            System.out.println("请输入选择课程的数量");
            inputNumber2 = new Scanner(System.in);
        }
        for (int i=0;i<students.length;i++){
            System.out.println("第"+(i+1)+"个学生信息为:");
            System.out.println("学生id:"+students[i].getId());
            System.out.println("学生姓名:"+students[i].getName());
            System.out.println("学生所选课程:"+students[i].getCourses());
        }
    }

}
